//
//  CommunityCollectionReusableView.m
//  PTravel
//
//  Created by dllo on 15/11/20.
//  Copyright © 2015年 李涵. All rights reserved.
//

#import "CommunityCollectionReusableView.h"

@implementation CommunityCollectionReusableView
- (void)dealloc
{
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changColor) name:@"night" object:nil];
        [self createSubViews];
    }
    return self;
}

- (void)changColor
{
    self.backgroundColor = CELLCOLOR;
}
- (void)createSubViews
{
    self.backgroundColor = CELLCOLOR;
    self.label = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 200, 28)];
    self.label.textColor = [UIColor blackColor];
    self.label.font = [UIFont systemFontOfSize:14];
    [self addSubview:self.label];
    [_label release];
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, BOUNDS.size.width, 0.3)];
    view.backgroundColor = [UIColor colorWithWhite:0.178 alpha:1.000];
    [self addSubview:view];
    [view release];
    
    self.backgroundColor = [UIColor colorWithWhite:0.851 alpha:1.000];
}

- (void)setListGroup:(ListGroup *)listGroup
{
    if (_listGroup != listGroup) {
        [_listGroup release];
        _listGroup = [listGroup retain];
    }
    
    self.label.text = listGroup.name;
    self.label.textColor = TEXTCOLOR;
}

@end
